package com.ECPDemo.pojo;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.List;

public class OrderInfo extends Order implements Serializable{
	
	
	private static final long serialVersionUID = 1L;
	
	private List<OrderItem> orderItems;
	
	private OrderShipping orderShipping;
	

	public List<OrderItem> getOrderItems() {
		return orderItems;
	}

	public void setOrderItems(List<OrderItem> orderItems) {
		this.orderItems = orderItems;
	}
	
	
	

	public OrderShipping getOrderShipping() {
		return orderShipping;
	}

	public void setOrderShipping(OrderShipping orderShipping) {
		this.orderShipping = orderShipping;
	}

	@Override
	public String toString() {
		return "OrderInfo [orderId=" + super.getOrderId() + ", payment=" + super.getPayment()
				+ ", paymentType=" + super.getPaymentType() + ", postFee=" + super.getPostFee()
				+ ", status=" + super.getStatus() + ", createTime=" + super.getCreateTime()
				+ ", updateTime=" + super.getUpdateTime() + ", paymentTime=" + super.getPaymentTime()
				+ ", consignTime=" + super.getConsignTime() + ", endTime=" + super.getEndTime()
				+ ", closeTime=" + super.getCloseTime() + ", shippingName=" + super.getShippingName()
				+ ", shippingCode=" + super.getShippingCode() + ", userId=" + super.getUserId()
				+ ", buyerMessage=" + super.getBuyerMessage() + ", buyerNick=" + super.getBuyerNick()
				+ ", buyerRate=" + super.getBuyerRate() + "orderItems=" + orderItems + ", orderShipping="
				+ orderShipping + "]";
	}

	
	
	public OrderInfo() {
		super();
	}
	private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	private String createTimeString;
	private String updateTimeString;
	private String paymentTimeString;
	private String consignTimeString;
	private String endTimeString;
	private String closeTimeString;
	public OrderInfo(Order order) {
		super();
		this.setOrderId(order.getOrderId());
		this.setPayment(order.getPayment());
		this.setPaymentType(order.getPaymentType());
		this.setPostFee(order.getPostFee());
		this.setStatus(order.getStatus());
		this.setCreateTime(order.getCreateTime());
		if(order.getCreateTime() != null){
			this.setCreateTimeString(dateFormat.format(order.getCreateTime()));
		}
		this.setUpdateTime(order.getUpdateTime());
		if(order.getUpdateTime() != null){
			this.setUpdateTimeString(dateFormat.format(order.getUpdateTime()));
		}
		this.setPaymentTime(order.getPaymentTime());
		if(order.getPaymentTime() != null){
			this.setPaymentTimeString(dateFormat.format(order.getPaymentTime()));
		}
		this.setConsignTime(order.getConsignTime());
		if(order.getConsignTime() != null){
			this.setConsignTimeString(dateFormat.format(order.getConsignTime()));
		}
		this.setEndTime(order.getEndTime());
		if(order.getEndTime() != null){
			this.setEndTimeString(dateFormat.format(order.getEndTime()));
		}
		this.setCloseTime(order.getCloseTime());
		if(order.getCloseTime() != null){
			this.setCloseTimeString(dateFormat.format(order.getCloseTime()));
		}
		this.setShippingName(order.getShippingName());
		this.setShippingCode(order.getShippingCode());
		this.setUserId(order.getUserId());
		this.setBuyerMessage(order.getBuyerMessage());
		this.setBuyerNick(order.getBuyerNick());
		this.setBuyerRate(order.getBuyerRate());
	}

	public String getCreateTimeString() {
		return createTimeString;
	}

	public void setCreateTimeString(String createTimeString) {
		this.createTimeString = createTimeString;
	}

	public String getUpdateTimeString() {
		return updateTimeString;
	}

	public void setUpdateTimeString(String updateTimeString) {
		this.updateTimeString = updateTimeString;
	}

	public String getPaymentTimeString() {
		return paymentTimeString;
	}

	public void setPaymentTimeString(String paymentTimeString) {
		this.paymentTimeString = paymentTimeString;
	}

	public String getConsignTimeString() {
		return consignTimeString;
	}

	public void setConsignTimeString(String consignTimeString) {
		this.consignTimeString = consignTimeString;
	}

	public String getEndTimeString() {
		return endTimeString;
	}

	public void setEndTimeString(String endTimeString) {
		this.endTimeString = endTimeString;
	}

	public String getCloseTimeString() {
		return closeTimeString;
	}

	public void setCloseTimeString(String closeTimeString) {
		this.closeTimeString = closeTimeString;
	}
	
	
	
	

	
}
